Objects in REALbasic are arranged in a hierarchy. This means that an object inherits the properties, methods, and events of its super class (the classes above it in the hierarchy) and may contain properties, methods, and events that are unique to the object.Cross-Platform Development
Using Target Flags
You can develop your application on one platform and compile it for up to three: Windows, Macintosh (classic and Mac OS X), and Linux. If your application will run on more than one platform, you can use the following global Boolean constants to determine which type of code is currently executing.
Boolean Constant | Description |
DebugBuild | The application is running within the REALbasic application, i.e., from clicking the Run button in the IDE toolbar. |
RBVersion | Returns the version of REALbasic that is being compiled. You can use this in an expression that evaluates to True or False to determine which version of REALbasic is compiling the application. |
TargetBigEndian | The compiled application is running on a machine and OS that uses the Big Endian byte ordering. |
TargetCarbon | The compiled application is currently running Carbon/Mac OS X code. |
TargetHasGUI | The application has a GUI, i.e., it is not a ConsoleApplication or a ServiceApplication. |
TargetLinux | The compiled application is running Linux code. |
TargetLittleEndian | The compiled application is running on a machine and OS that uses the Little Endian byte ordering. |
TargetMachO | The compiled application is running on Mac OS X, running object code in the format for the Mach kernel. |
TargetMacOS | The compiled application is currently running Macintosh code, PPC 'classic', or Mac OS X, in either the MachO or PEF formats. |
TargetMacOSClassic | The compiled application is currently running PowerPC code within a 'classic' Mac O supported by REALbasic (Mac OS 8-9). |
TargetWin32 | The compiled application is currently running Win32 code. |
Conditional Compilation
If some of your code should be compiled only for a particular target platform (such as AppleScript-specific code or Declare statements), you can use #If statements to compile that code only for the appropriate platform. Use the following structure:
//OS-specific code
//included in built app
//only for target platform
#Else (optional)
(optional code)
#ElseIf TargetBoolean //(optional)
//(optional) Other OS-specific code
#Endif